<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        .money{width: 8em;}
    </style>
    <link href="/Public/common.css" rel="stylesheet">
</head>
<body>
<form id="queryForm" style="margin: 1em;" action="<{u('Game/getUserList')}>" method="post" target="_blank">
开始时间：<input type="text" id="gameDate" name="begin">
结束时间：<input type="text" id="gameDate2" name="end">
用户编号：<input type="text" id="userid" name="userid">
代理编号：<input type="text" id="agent" name="agent" value="<{$agent}>">
    <input type="hidden" name="export" id="exportField" />
    <input type="button" value="查询"  id="search" />
    <input type="button" value="导出"  id="export" />导出操作需大量计算，请耐心等待结果
</form>

<table border="1">
    <thead>
    <tr>
        <th>用户ID</th>
        <th>用户昵称</th>
        <th>代理</th>
        <th>代理绑定时间</th>
        <th>充值金额</th>
        <th>消耗钻石</th>
        <th>剩余钻石</th>
        <th>参与牌局数</th>
        <th>开房总数</th>
        <th>3局开房数</th>
        <th>6局开房数</th>
        <th>9局开房数</th>
    </tr>
    </thead>
    <tbody id="dataContent">
    <{include file="UserCount_data.html" }>
    </tbody>

</table>
<div id="footer">
    <{include file="pager.html" }>
</div>



<script src="/Public/js/jquery-2.1.4.min.js"></script>
<script src="/Public/layer/layer.js"></script>
<script src="/Public/My97DatePicker/WdatePicker.js"></script>
<script>

    $('#search').click(function(){
        query(1);
    });
    $('#export').click(function(){
        $('#exportField').val(1);
        $('#queryForm').submit();
    });

    var tipIndex=0;
    function query(page){
        if(!page)page=1;
        $('#exportField').val(0);
        var data=$("#queryForm").serialize()+"&page="+page;

        var tipIndex = layer.load(1, {
            shade: [0.1,'#fff'] //0.1透明度的白色背景
        });
        $.post("<{U('Game/getUserList')}>",data,function(re){
            layer.close(tipIndex)
            if(re.status==0){
                $('#dataContent').html(re.html);
                $('#footer').html(re.page);
                return;
            }else{
                alert(re.msg);
            }

        },'JSON');
    }

    function page(toPage){
        query(toPage);
    }

    function jump(){
        query($('#jp').val());
    }



</script>


<script>
    /**
     * 日期联动
     * @param start
     * @param end
     */
    function datePickter(start,end,isDate){
        if(isDate){
            dateFmt='yyyy-MM-dd';
        }else{
            dateFmt='yyyy-MM-dd HH:mm';
        }
        if( end !== undefined && end ) {
            $("#"+start).focus(function(){
                WdatePicker({
                    onpicked:function(){
                        $("#"+end).focus()
                    },
                    maxDate:'#F{$dp.$D('+end+')}',
                    dateFmt:dateFmt
                })
            });
            $("#" + end).focus(function () {
                WdatePicker({
                    dateFmt: dateFmt,
                    minDate: '#F{$dp.$D(' + start + ')}'
                })
            });
        }else {
            $("#"+start).focus(function(){
                WdatePicker({dateFmt:dateFmt});
            });
        }
    }
    datePickter('gameDate','gameDate2',true);

</script>

</body>
</html>